package com.example.my_dubbo.loadBalance;

import java.util.Random;

/**
 * @author 何可人
 * @version 1.0
 * @description: TODO
 * @date 2022/12/9 10:24
 */
public class RandomLoadBalance { // random.nextInt
    public static void main(String[] args) {
       for(int i = 0;i<10;i++){
           System.out.println(getServerName());
       }
    }

    public static String getServerName(){
        Random random = new Random();
        int index = random.nextInt(ServerIps.LIST.size());
        return ServerIps.LIST.get(index);
    }
}
